class SpinLock():
    _spinLock = False
    _v = None
    def __init__(self, v):
        self._v = v
        self._spinLock = False
        
    def run(self, op):
        while self._spinLock:
            pass
        self._spinLock= True
        ret = op(self._v)
        self._spinLock = False
        return ret
